package com.ruoyi.ybUpload.service.tableCode.impl;

import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.ybUpload.domain.tableCode.ZsOutStock;
import com.ruoyi.ybUpload.service.tableCode.IZsOutStockService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.ybUpload.mapper.ZsOutStockMapper;

import java.util.List;

/**
 * 商品出库Service业务层处理
 *
 * @author ruoyi
 * @date 2024-09-03
 */
@Service
public class ZsOutStockServiceImpl implements IZsOutStockService
{
    @Autowired
    private ZsOutStockMapper zsOutStockMapper;

    /**
     * 查询商品出库
     *
     * @param id 商品出库主键
     * @return 商品出库
     */
    @Override
    public ZsOutStock selectZsOutStockById(Long id)
    {
        return zsOutStockMapper.selectZsOutStockById(id);
    }

    /**
     * 查询商品出库列表
     *
     * @param zsOutStock 商品出库
     * @return 商品出库
     */
    @Override
    public List<ZsOutStock> selectZsOutStockList(ZsOutStock zsOutStock)
    {
        return zsOutStockMapper.selectZsOutStockList(zsOutStock);
    }

    /**
     * 新增商品出库
     *
     * @param zsOutStock 商品出库
     * @return 结果
     */
    @Override
    public int insertZsOutStock(ZsOutStock zsOutStock)
    {
        zsOutStock.setDelFlag(0L);
        zsOutStock.setCreateTime(DateUtils.getNowDate());
        return zsOutStockMapper.insertZsOutStock(zsOutStock);
    }

    /**
     * 修改商品出库
     *
     * @param zsOutStock 商品出库
     * @return 结果
     */
    @Override
    public int updateZsOutStock(ZsOutStock zsOutStock)
    {
        zsOutStock.setUpdateTime(DateUtils.getNowDate());
        return zsOutStockMapper.updateZsOutStock(zsOutStock);
    }

    /**
     * 批量删除商品出库
     *
     * @param ids 需要删除的商品出库主键
     * @return 结果
     */
    @Override
    public int deleteZsOutStockByIds(Long[] ids)
    {
        return zsOutStockMapper.deleteZsOutStockByIds(ids);
    }

    /**
     * 删除商品出库信息
     *
     * @param id 商品出库主键
     * @return 结果
     */
    @Override
    public int deleteZsOutStockById(Long id)
    {
        return zsOutStockMapper.deleteZsOutStockById(id);
    }
}